<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script src="/js/vue.js"></script>
    <script src="/js/axios.js"></script>
    <script src="/js/util.js"></script>
</head>
<body>

    <div id="app">

        姓名:<input v-model="pojo.name">
        年龄：<input v-model="pojo.age">
        性别：<input v-model="pojo.sex">



        <button @click="save()">添加</button>


    </div>

    <script>
        new Vue({
            el:"#app",
            data:{
                pojo:{}
            },
            created(){
            },
            methods:{
                save(){
                    axios.post("/student/add",this.pojo).then(
                        res => {
                            alert("添加成功")
                            location.href = "list.html"
                        }
                    )
                }
            }
        })
    </script>

</body>
</html>